package edu.gmu.project.swe;
/**
 * 
 * @author quynhtran
 *
 */
public enum MsgCode{
	
	/**
	 *-1 = File Not Found Error => "-1-filename[,]"
	 * 1 = Request file list on server =>  "1-filename[,]"
	 * 2 = File Summary =>  "2-filename:size[,]"
	 * 3 = File and Offset => "3-filename:size[,]" 
	 */
	ACCEPT(0), FNF_ERROR(-1), FILE_REQUEST(1), FILE_SUMMARY(2), POINTER(3), FILE_RCVD(4);
	private int value;
	
	private MsgCode(int value){
		this.value = value;
	}
	public int getValue(){
		return this.value;
	}
	public static void main(String[] args){
		
		String clientRequest = String.valueOf(MsgCode.FILE_REQUEST.getValue())+  ":"+MsgCode.FILE_REQUEST.name();
		System.out.println("Client msg to server: "+ clientRequest);
		
		String serverResponse = MsgCode.FILE_SUMMARY.getValue() + ":test1.txt:300,test2.txt:200";
		System.out.println("Server msg to client: "  + serverResponse);
		
		}
}
